import java.util.Scanner;

public class TestDome {
    public static void main(String[] args) {
        String password = "2021010160124";
        Scanner scanner = new Scanner(System.in);
        System.out.print("请输入密码：");
        for (int i = 0; i < 3; i++) {
            String enterPassword = scanner.nextLine();
            if (enterPassword.equals(password)){
                System.out.println("登录成功");
            }else if (i < 2){
                System.out.print("密码错误，请重新输入：");
            }else {
                System.out.println("退出登录");
            }
        }
    }
}

